<template>
  <div class="app-container">
    <el-tabs v-model="currentTabName" @tab-click="handleClick">
      <el-tab-pane label="监控记录" name="Log">
        <Log v-if="currentTabName === 'Log'" />
      </el-tab-pane>
      <el-tab-pane v-if="checkPermission(permissionRoles.monitor_rule)" label="监控规则" name="Rule">
        <Rule v-if="currentTabName === 'Rule'" />
      </el-tab-pane>
      <el-tab-pane v-if="checkPermission(permissionRoles.monitor_config)" label="关键词配置" name="Keyword">
        <Keyword v-if="currentTabName === 'Keyword'" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import checkPermission from '@/utils/permission'
import Log from './components/log'
import Rule from './components/rule'
import Keyword from './components/keyword'

export default {
  name: 'List',
  components: { Log, Rule, Keyword },
  data() {
    return {
      permissionRoles: this.$store.state.user.permissionRoles,
      currentTabName: 'Log'
    }
  },
  methods: {
    checkPermission,
    handleClick() {}
  }
}
</script>
